<template>
  <panel title="商品添加">
    <goodsForm @form='form'></goodsForm>
  </panel>
</template>

<script>
import { goodsAddReq } from '@/api/goods.api'

import goodsForm from './components/GoodsForm.vue'
  export default {
  components: { goodsForm },
    methods:{
      form(form){
        // console.log(form);
        goodsAddReq(form).then(res => {
          if(res.data.code === 0){
            this.$router.push('/goods/list')
          }
        })
      }
    }

  }
</script>

<style lang="less" scoped>

</style>